<?php



require "database.php";


require "../config/config.php";

$base=new Db($__conf__);

$post=$_POST;



// tp_ts


$user=$base->doSql('select * from tp_user where token="'.$post["uid"].'"');
if (!$user) {
	return json([
		"code"=>400,
		"msg"=>"System Error",
		"requestDate"=>date("Y-m-d H:i:s"),
		"data"=>null
	]);
}

//	uid 	username 	orderid 	phone 	tsobj 	tscontent 	tsfanan 	addtime 	status 
$____d____=$base->doSql('insert into tp_ts set uid="'.$user[0]["id"].'",username="'.$user[0]["username"].'",orderid="'.$post["orderid"].'",phone="'.$post["phone"].'",tsobj="'.$post["tsobj"].'",tscontent="'.$post["tscontent"].'",tsfanan="'.$post["tsfanan"].'",addtime="'.time().'"');


if ($____d____) {
	return json([
		"code"=>200,
		"msg"=>"Successful",
		"requestDate"=>date("Y-m-d H:i:s"),
		"data"=>null
	]);
}else{
	return json([
		"code"=>400,
		"msg"=>"System Error",
		"requestDate"=>date("Y-m-d H:i:s"),
		"data"=>null
	]);
}
